from rest_framework.viewsets import ModelViewSet
from django.contrib.auth.models import Permission, ContentType
from apps.meiduo_admin.serializers.permission import PermissionSerializer, ContentTypeSerializer
from apps.meiduo_admin.utils import PageNum
from rest_framework.generics import ListAPIView


class PermissionModelViewSet(ModelViewSet):
    queryset = Permission.objects.all().order_by('id')
    serializer_class = PermissionSerializer
    pagination_class = PageNum


class ContentTypeListAPIView(ListAPIView):
    queryset = ContentType.objects.all()
    serializer_class = ContentTypeSerializer
